<script setup>
import { RouterView } from 'vue-router'
</script>

<template>
  <el-container>
    <el-header class="header">
      <div class="header-left">
        <div class="logo">
          <el-icon>
            <TrendCharts />
          </el-icon>
          <span>股达</span>
        </div>
        <span class="welcome-text">👋 欢迎回来，QJR</span>
      </div>
      <div class="header-right">
        <span class="quick-entry">快捷入口</span>
        <div class="quick-icons">
          <el-icon class="quick-icon">
            <Document />
          </el-icon>
          <el-icon class="quick-icon">
            <PieChart />
          </el-icon>
          <el-icon class="quick-icon">
            <TrendCharts />
          </el-icon>
        </div>
      </div>
    </el-header>
    <el-container>
      <el-aside width="200px" class="sidebar">
        <el-menu default-active="/hot-money-list" :default-openeds="['2']" class="sidebar-menu" background-color="#001529" text-color="#fff"
          active-text-color="#1890ff" router>
          <el-menu-item index="/">
            <el-icon>
              <Odometer />
            </el-icon>
            <span>仪表盘</span>
          </el-menu-item>
          <el-sub-menu index="2">
            <template #title>
              <el-icon>
                <Monitor />
              </el-icon>
              <span>游资雷达</span>
            </template>
            <el-menu-item index="/hot-money-list">
              <span>游资列表</span>
            </el-menu-item>
            <el-menu-item index="/stock-list">
              <span>股票列表</span>
            </el-menu-item>
          </el-sub-menu>
          <!-- <el-sub-menu index="3">
             <template #title>
               <el-icon>
                 <DataAnalysis />
               </el-icon>
               <span>数据可视化</span>
             </template>
             <el-menu-item index="/price-chart-demo">
               <span>价格图表</span>
             </el-menu-item>
             <el-menu-item index="/trading-chart-demo">
               <span>交易图表</span>
             </el-menu-item>
           </el-sub-menu>
          <el-menu-item index="4">
            <el-icon>
              <List />
            </el-icon>
            <span>列表页</span>
          </el-menu-item>
         -->
        </el-menu>
      </el-aside>
      <el-main class="main-container">
        <RouterView />
      </el-main>
    </el-container>
  </el-container>
</template>

<style>
body {
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  background-color: #f5f7fa;
  overflow: hidden;
}

.el-container {
  height: 100vh;
  overflow: hidden;
}

.main-container {
  background-color: #f5f7fa;
  overflow-y: auto;
}

/* 头部样式 */
.header {
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
  height: 60px;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  margin-right: 24px;
  color: #1890ff;
  font-size: 18px;
  font-weight: bold;
}

.logo .el-icon {
  margin-right: 8px;
  font-size: 24px;
  color: #1890ff;
}

.welcome-text {
  font-size: 16px;
  color: #262626;
}

.header-right {
  display: flex;
  align-items: center;
}

.quick-entry {
  margin-right: 16px;
  color: #8c8c8c;
  font-size: 14px;
}

.quick-icons {
  display: flex;
  gap: 12px;
}

.quick-icon {
  font-size: 18px;
  color: #8c8c8c;
  cursor: pointer;
  transition: color 0.3s;
}

.quick-icon:hover {
  color: #1890ff;
}

/* 侧边栏样式 */
.sidebar {
  background-color: #001529;
}

.sidebar-menu {
  border: none;
}
</style>
